from rest_framework import serializers

from system.models import Roles, Permissions
from system.serializers.permissions import PermissionsSerializer


class RoleSerializers(serializers.ModelSerializer):
    """
    角色表序列化器
    """
    permissions = PermissionsSerializer(many=True)
    class Meta:
        model = Roles
        fields = "__all__"
        # fields = ["id", "name", "desc", "permissions"]